home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / fx / RampageTrailB.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  2.2 KB  |  65 lines

  1. class classes.fx.RampageTrailB
  2. {
  3.    var x;
  4.    var y;
  5.    var id;
  6.    var clip;
  7.    var cMax;
  8.    var trans;
  9.    var colorTrans;
  10.    var colorArray;
  11.    var colorL;
  12.    var colorC;
  13.    var xMov = 0;
  14.    var yMov = 0;
  15.    var c = 0;
  16.    var colorArray1 = [[255,0,0],[255,125,0],[255,255,0],[255,125,0],[255,255,255],[255,0,0],[255,255,0],[255,125,0],[255,0,0]];
  17.    var colorArray2 = [[0,255,0],[0,255,125],[0,255,255],[0,125,255],[0,0,255],[255,255,255],[125,255,255],[0,125,255],[0,255,255]];
  18.    var colorArray3 = [[0,125,255],[255,0,125],[255,0,255],[255,255,255],[255,0,125],[0,255,255],[125,255,255],[0,125,255],[0,255,0]];
  19.    var Name = "rampageTrailB";
  20.    function RampageTrailB(px, py, pid)
  21.    {
  22.       this.x = px;
  23.       this.y = py;
  24.       this.id = pid;
  25.       _root.d = _root.d + 1;
  26.       this.clip = _root.attachMovie("rampageTrail","rampageTrailB" + this.id + "Clip",_root.d);
  27.       this.clip._x = this.x;
  28.       this.clip._y = this.y;
  29.       this.clip.gotoAndStop("shape4");
  30.       this.xMov = _root.randRange(-3,3);
  31.       this.yMov = _root.randRange(-3,3);
  32.       this.cMax = _root.randRange(50,100);
  33.       this.trans = new flash.geom.Transform(this.clip);
  34.       this.colorTrans = new flash.geom.ColorTransform(0,0,0,1,0,0,0,1);
  35.       this.colorArray = this["colorArray" + _root.randRange(1,3)].slice();
  36.       delete this.colorArray1;
  37.       delete this.colorArray2;
  38.       delete this.colorArray3;
  39.       this.colorL = this.colorArray.length;
  40.       this.colorC = -1;
  41.    }
  42.    function main()
  43.    {
  44.       this.c = this.c + 1;
  45.       if(this.c >= this.cMax)
  46.       {
  47.          _root.removeFX("rampageTrailB" + this.id);
  48.       }
  49.       this.colorC = this.colorC + 1;
  50.       if(this.colorC > this.colorL)
  51.       {
  52.          this.colorC = 0;
  53.       }
  54.       this.colorTrans.redOffset = this.colorArray[this.colorC][0];
  55.       this.colorTrans.greenOffset = this.colorArray[this.colorC][1];
  56.       this.colorTrans.blueOffset = this.colorArray[this.colorC][2];
  57.       this.trans.colorTransform = this.colorTrans;
  58.       this.clip._alpha = 100 - this.c * (100 / this.cMax);
  59.       this.x += this.xMov;
  60.       this.y += this.yMov;
  61.       this.clip._x = this.x;
  62.       this.clip._y = this.y;
  63.    }
  64. }
  65.